package com.example.scheduled;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.text.SimpleDateFormat;
import java.util.Date;

@EnableScheduling
@SpringBootApplication
public class ScheduledApplication implements ApplicationRunner {


    public static void main(String[] args) {
        SpringApplication.run(ScheduledApplication.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
        System.out.println(dateFormat.format(new Date()));
    }
}
